(module
  (import "env" "assert_eq_i32" (func $assert_eq_i32 (param i32 i32)))
  (import "env" "assert_eq_i64" (func $assert_eq_i64 (param i64 i64)))
  (import "env" "assert_eq_f32" (func $assert_eq_f32 (param f32 f32)))
  (import "env" "assert_eq_f64" (func $assert_eq_f64 (param f64 f64)))
  (memory 1)
  (data 0 (offset (i32.const 100)) "hello")
  (start $main)
  (func $main (export "main")
    (call $assert_eq_i32 (i32.load offset=99 (i32.const 1)) (i32.const 0x6C6C_6568))
    (call $assert_eq_i32 (i32.load offset=98 (i32.const 2)) (i32.const 0x6C6C_6568))

    (call $assert_eq_i32 (memory.size) (i32.const 1))
    (call $assert_eq_i32 (memory.grow (i32.const 1)) (i32.const 1))
    (call $assert_eq_i32 (memory.size) (i32.const 2))

    (i32.store offset=0 (i32.const  0) (i32.const 0x1234_5678))
    (i64.store offset=1 (i32.const  3) (i64.const 0x1234_5678_90AB_CDEF))
    (f32.store offset=2 (i32.const 10) (f32.const 1.5))
    (f64.store offset=3 (i32.const 13) (f64.const 2.5))
    (call $assert_eq_i32 (i32.load offset=0 (i32.const 0)) (i32.const 0x1234_5678))
    (call $assert_eq_i64 (i64.load offset=2 (i32.const 2)) (i64.const 0x1234_5678_90AB_CDEF))
    (call $assert_eq_f32 (f32.load offset=8 (i32.const 4)) (f32.const 1.5))
    (call $assert_eq_f64 (f64.load offset=9 (i32.const 7)) (f64.const 2.5))

    (i32.store8  offset=0 (i32.const 0) (i32.const 0x0000_0012))
    (i32.store16 offset=0 (i32.const 1) (i32.const 0x0000_3456))
    (i64.store8  offset=1 (i32.const 2) (i64.const 0x0000_0000_0000_0078))
    (i64.store16 offset=1 (i32.const 3) (i64.const 0x0000_0000_0000_90AB))
    (i64.store32 offset=2 (i32.const 4) (i64.const 0x0000_0000_CDEF_0123))
    (call $assert_eq_i64 (i64.load32_u offset=0 (i32.const 0)) (i64.const 0x7834_5612))
    (call $assert_eq_i64 (i64.load16_u offset=1 (i32.const 3)) (i64.const 0x90AB))
    (call $assert_eq_i64 (i64.load8_u  offset=2 (i32.const 4)) (i64.const 0x23))
    (call $assert_eq_i32 (i32.load16_u offset=3 (i32.const 4)) (i32.const 0xEF01))
    (call $assert_eq_i32 (i32.load8_u  offset=4 (i32.const 5)) (i32.const 0xCD))
    (call $assert_eq_i32 (i32.load8_s  offset=0 (i32.const 9)) (i32.const 0xFFFF_FFCD))
    (call $assert_eq_i32 (i32.load16_s offset=1 (i32.const 7)) (i32.const 0xFFFF_CDEF))
    (call $assert_eq_i64 (i64.load8_s  offset=2 (i32.const 7)) (i64.const 0xFFFF_FFFF_FFFF_FFCD))
    (call $assert_eq_i64 (i64.load16_s offset=3 (i32.const 5)) (i64.const 0xFFFF_FFFF_FFFF_CDEF))
    (call $assert_eq_i64 (i64.load32_s offset=4 (i32.const 2)) (i64.const 0xFFFF_FFFF_CDEF_0123))
  )
)
